﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Chapter20.View
{
    using Chapter20.ViewModel;
    using System.Data;
    using System.Collections;
    using System.Collections.ObjectModel;

    /// <summary>
    /// BindProductObject.xaml 的交互逻辑
    /// </summary>
    public partial class BrushConverterWindow : Window
    {
        private DataTable products;

        public BrushConverterWindow()
        {
            InitializeComponent();
        }

        private void getDataButton_Click(object sender, RoutedEventArgs e)
        {
            products = App.StoreDBDataSet.GetProducts();
            productsListBox.ItemsSource = products.DefaultView;
            dateTextBox.DataContext = DateTime.Today;
        }

        private void deleteButton_Click(object sender, RoutedEventArgs e)
        {
            products.DefaultView.Delete(productsListBox.SelectedIndex);
        }

        private void changedButton_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}
